package app

import (
	"hft/global"
	"log"

	"github.com/oschwald/geoip2-golang"
)

// 初始化打开ip库
func InitGeo() *geoip2.Reader {
	db, err := geoip2.Open(global.OC_CONFIG.IpGeo.Source)
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()
	return db
}
